One or more aspects relate, in general, to processing within a computing environment, and in particular, to improving such processing.
Applications executing within a processor of a computing environment control the behavior of the processor. The applications are created using programming languages which are designed to communicate instructions to the processor. There are various types of programming languages, and each language may use one or more types of encodings to represent data.
For example, scaled decimal integers (also known as scaled binary coded decimals/scaled BCD) are a common data type in many COBOL and PL/I programs, as well as in DB2 database management systems. A scaled BCD number is a BCD number plus a format descriptor (n·k), where the BCD number is interpreted to have n digits before the decimal point and k digits after the decimal point (i.e., with k fraction digits), or a decimal integer to be multiplied by 10−k.
Performing addition and subtraction on scaled BCD data with the same k-parameter is straight forward because the data is correctly aligned and the result has the same number of fraction digits. Multiplication is more complex because the full width intermediate product of two (n·k) numbers has (2n·2k) digits, but the desired result usually is (2n·k).
Conventional decimal multiply instructions deliver the least significant L digits, and may have severe length restrictions. The code for performing scaled BCD multiply can be fairly complex, requiring multiple multiply, shift, and add operations.